package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.EDepartmentMapper;
import com.ruoyi.common.core.domain.e_enterprise.EDepartment;
import com.ruoyi.enterprise.service.IEDepartmentService;

/**
 * 部门信息Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class EDepartmentServiceImpl implements IEDepartmentService 
{
    @Autowired
    private EDepartmentMapper eDepartmentMapper;

    /**
     * 查询部门信息
     * 
     * @param id 部门信息主键
     * @return 部门信息
     */
    @Override
    public EDepartment selectEDepartmentById(Long id)
    {
        return eDepartmentMapper.selectEDepartmentById(id);
    }

    /**
     * 查询部门信息列表
     * 
     * @param eDepartment 部门信息
     * @return 部门信息
     */
    @Override
    public List<EDepartment> selectEDepartmentList(EDepartment eDepartment)
    {
        return eDepartmentMapper.selectEDepartmentList(eDepartment);
    }

    /**
     * 新增部门信息
     * 
     * @param eDepartment 部门信息
     * @return 结果
     */
    @Override
    public int insertEDepartment(EDepartment eDepartment)
    {
        eDepartment.setCreateTime(DateUtils.getNowDate());
        return eDepartmentMapper.insertEDepartment(eDepartment);
    }

    /**
     * 修改部门信息
     * 
     * @param eDepartment 部门信息
     * @return 结果
     */
    @Override
    public int updateEDepartment(EDepartment eDepartment)
    {
        eDepartment.setUpdateTime(DateUtils.getNowDate());
        return eDepartmentMapper.updateEDepartment(eDepartment);
    }

    /**
     * 批量删除部门信息
     * 
     * @param ids 需要删除的部门信息主键
     * @return 结果
     */
    @Override
    public int deleteEDepartmentByIds(Long[] ids)
    {
        return eDepartmentMapper.deleteEDepartmentByIds(ids);
    }

    /**
     * 删除部门信息信息
     * 
     * @param id 部门信息主键
     * @return 结果
     */
    @Override
    public int deleteEDepartmentById(Long id)
    {
        return eDepartmentMapper.deleteEDepartmentById(id);
    }
}
